<?php

require_once ('Zend\Form.php');

class Application_Form_AddComment extends Zend_Form {
	
	public function init() {
		// Set the method for the display form to POST
		$this->setMethod ( 'post' );		
		$this->setOptions(array('id'=>'commentForm'));
		
		//fromUrl
		$fromUrl = new Zend_Form_Element_Hidden('fromUrl');
		$fromUrl->removeDecorator('DtDdWrapper');
     	$fromUrl->removeDecorator('HtmlTag');
      	$fromUrl->removeDecorator('Label');
		
		//content_type
		$ct = new Zend_Form_Element_Hidden('contentType');
		$ct->removeDecorator('DtDdWrapper');
     	$ct->removeDecorator('HtmlTag');
      	$ct->removeDecorator('Label');
      	
      	//content_id
		$ci = new Zend_Form_Element_Hidden('contentId');
		$ci->removeDecorator('DtDdWrapper');
     	$ci->removeDecorator('HtmlTag');
      	$ci->removeDecorator('Label');
      	
      	//user id
		$userId = new Zend_Form_Element_Hidden('userId');
		$userId->removeDecorator('DtDdWrapper');
     	$userId->removeDecorator('HtmlTag');
      	$userId->removeDecorator('Label');
      	
		$this->addElements(array($fromUrl, $ct, $ci, $userId));

		
		// Add the comment element
		$this->addElement ( 'textarea', 
			'comment', 
			array ('label' => 'Add your comment:', 
				'required' => true, 
				'validators' => array (array ('validator' => 'StringLength', 'options' => array (10, 200 ) ) ),
			) );
			
		// Add the submit button
		$this->addElement ( 'submit', 'submit', array ('ignore' => true, 'label' => 'comment' ) );
		
	}
}

